package org.example.springtrans.service;

import lombok.extern.slf4j.Slf4j;
import org.example.springtrans.mapper.UserInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
@Slf4j
public class UserService {
    @Autowired
    private UserInfoMapper userInfoMapper;

    @Transactional(propagation = Propagation.REQUIRED)
    public void register(String username, String password) {
        // 插入用户信息
        userInfoMapper.isnert(username, password);
    }

}
